package javabase.schoolwork.day5_28;

/**
 * @author fance
 * @date 2018/5/29 9:51
 */
public class Account {
    protected double balance;

    public Account(double init_balance) {
        this.balance = init_balance;
    }

    public double getBalance() {
        return balance;
    }

   /* public void deposit(double money) {
        this.balance += money;
    }
    public void withdaw(double money) {
        this.balance -= money;
    }*/
   public boolean deposit(double money) {
        this.balance += money;
        return true;
   }
    public boolean withdaw(double money) {
        if (money > this.balance) {
            return false;
        } else {
            this.balance -= money;
            return true;
        }
    }
}
